export function addClass (el, className) {
  el.classList.add(className)
}
export function group (array, subGroupLength) {
  if (array.length <= subGroupLength) {
    return array
  }

  let index = 0
  let newArray = []
  while (index < array.length) {
    newArray.push(array.slice(index, index += subGroupLength))
  }

  return newArray
}

export function searchGroup (mapData) {
  let map = {
    title: mapData.title,
    option: []
  }
  map.option = group(mapData.option, 3)
  return map
}
